package com.ruoyi.system.domain.bo;

import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlCData;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import lombok.Data;
import lombok.val;


@Data
//@JacksonXmlRootElement(localName = "RULE_NODE")
public class RuleNode {
    @JacksonXmlProperty(localName = "RULE_INFO")
    private String ruleInfo;

    @JacksonXmlProperty(localName = "SEAL_CODE")
    private String sealCode;

    public RuleNode(String ruleInfo, String sealCode) {
        this.ruleInfo = ruleInfo;
        this.sealCode = sealCode;
    }

    public String toJson() {
        Gson gson = new GsonBuilder().disableHtmlEscaping().create();
        return gson.toJson(this);
    }

    @Override
    public String toString() {
        return "{" +
            "'ruleInfo':'" + ruleInfo + '\'' +
            ", 'sealCode':'" + sealCode + '\'' +
            '}';
    }
}
